In Bitcoin, a rule called the “Longest Chain Rule” is used to resolve the
conflict. Assume that Block 5 1 is valid in the example. The first is 5 1a
which is the assumption, so we start building the next block on that, trying
to create 5 2a.
Mine on the first block you see
↓ ↓
Block 48 ►
Block 49 ►
Bock 5 0 ►
Block 5 1a ►
Block 5 2a
The first block you see may be treated as legitimate.
In a few seconds, however, you may see 5 1b. K eep an eye on it if you see
this. Later, if you see 5 2b, the “longest chain rule” suggests that you regard
the longest “b” chain as the valid one (…
5 0, 5 1b, 5 2b) and ignore the
shorter chain (…
5 0, 5 1a). So, stop trying to make 5 2a and instead start
trying to make 5 3 b.
Mine on top of the longest chain you have seen
►
Block 5 1a ↓ ↓
Block 48 ►
Block 49 ►
Block 5 0 ►
Block 5 1b ►
Block 5 2b ►
Block
5 3 b
►
Block 5 1c
Treat the longest chain as legitimate as per the longest chain rule if you see
multiple blocks.
The “longest chain rule” is used to resolve these conflicts, which are
common in distributed networks in the bitcoin blockchain ecosystem.
Figure 2.4 displays the Merkle tree data structure representation